import Vue from 'vue'
import Router from 'vue-router'
/*登陆文件夹Login*/
const Login = () =>
  import ('@/page/Login/Login'); //登录页

//const ForgetPwd = () => import('@/page/Login/ForgetPwd');  //忘记密码

import ForgetPwd from '@/page/Login/ForgetPwd'


const InitialPwd = () =>
  import ('@/page/Login/InitialPwd'); //更改初始密码

/*首页文件夹Index*/
const Index = () =>
  import ('@/page/Index/Index'); //首页(登录成功后跳转)
const PayNotice = () =>
  import ('@/page/Index/Notice/PayNotice'); //缴费通知
const PaySuccess = () =>
  import ('@/page/Index/Notice/PaySuccess'); //缴费成功
  const PayNoticePublic = () =>
  import ('@/page/Index/Notice/PayNoticePublic');
const RefundNotice = () =>
  import ('@/page/Index/Notice/RefundNotice'); //退费通知
const FinancialDetail = () =>
  import ('@/page/Index/Financial/FinancialDetail'); //儿童理财
const RightsDetail = () =>
  import ('@/page/Index/Rights/RightsDetail'); //权益详情

/*银行卡文件夹BankCard*/
const BindingCar = () =>
  import ('@/page/BankCard/BindingCar'); //

/*我的文件夹My*/
const BabyGrowth = () =>
  import ('@/page/My/BabyGrowth'); //绑定银行卡
const BabyPersonal = () =>
  import ('@/page/My/BabyPersonal'); //我的宝贝金库
const CheckPerfectInfo = () =>
  import ('@/page/My/CheckPerfectInfo'); //完善信息确认(第一次成功登录时跳转)
const SuccessInfo = () =>
  import ('@/page/My/SuccessInfo'); //完善信息成功
const SetPayPwd = () =>
  import ('@/page/My/SetPayPwd'); //设置支付密码
const Bill = () =>
  import ('@/page/My/Bill'); //幼儿园账单
const Capital = () =>
  import ('@/page/My/Capital'); //资金明细
const Balance = () =>
  import ('@/page/My/Balance'); //我的余额
const MyPay = () =>
  import ('@/page/My/MyPay'); //我的缴费通知

/*院长端  Admin*/
const Admin = () =>
  import ('@/page/Admin/Admin'); //院长端

/*理财产品详情*/
const Product = () =>
  import ('@/page/Product/Product'); //理财产品详情


Vue.use(Router)

const router = new Router({

  routes: [
    /*登陆类*/
    //初始登陆页面
    {
      path: '/',
      component: Login,
      meta: {
        title: '淘迪儿童银行-登录',
      },
    },
    {
      path: '/Login',
      name: 'Login',
      component: Login,
      meta: {
        title: '淘迪儿童银行-登录',
      },
    },
    {
      //忘记密码
      path: '/ForgetPwd',
      name: 'ForgetPwd',
      component: ForgetPwd,
      meta: {
        title: '忘记密码',
        requiresAuth: true
      }
    },
    {
      //更改初始密码
      path: '/InitialPwd',
      name: 'InitialPwd',
      component: InitialPwd,
      meta: {
        title: '更改初始密码'
      }
    },





    /*首页类*/
    {
      //首页
      path: '/Index',
      name: 'Index',
      component: Index,
      meta: {
        title: '淘迪儿童银行'
      }
    },
    {
      //缴费通知
      path: '/PayNotice',
      name: 'PayNotice',
      component: PayNotice,
      meta: {
        title: '淘迪儿童银行-缴费通知'
      },
    },
    {
      //常规通知
      path: '/PayNoticePublic/:childrenid/:id/:type/:view',
      name: 'PayNoticePublic',
      component: PayNoticePublic,
      meta: {
        title: '淘迪儿童银行-常规通知'
      },
    },
    {
      //缴费成功
      path: '/PaySuccess/',
      name: 'PaySuccess',
      component: PaySuccess,
      meta: {
        title: '淘迪儿童银行-缴费成功'
      }
    },
    {
      //退费通知
      path: '/RefundNotice/:childrenid/:type/:id/:view',
      name: 'RefundNotice',
      component: RefundNotice,
      meta: {
        title: '淘迪儿童银行-退费通知'
      }
    },
    {
      //儿童理财
      path: '/FinancialDetail',
      name: 'FinancialDetail',
      component: FinancialDetail,
      meta: {
        title: '淘迪儿童银行-儿童理财'
      }
    },
    {
      //权益详情
      path: '/RightsDetail',
      name: 'RightsDetail',
      component: RightsDetail,
      meta: {
        title: '淘迪儿童银行'
      }
    },
    {
      //账户余额
      path: '/Balance',
      name: 'Balance',
      component: Balance,
      meta: {
        title: '账户余额'
      }
    },






    /*银行卡类*/
    {
      //绑定银行卡
      path: '/BindingCar',
      name: 'BindingCar',
      component: BindingCar,
      meta: {
        title: '淘迪儿童银行-绑定银行卡'
      }
    },






    /*我的分类*/
    {
      //宝贝成长计划
      path: '/BabyGrowth',
      name: 'BabyGrowth',
      component: BabyGrowth,
      meta: {
        title: '宝贝成长计划'
      }
    },
    {
      //宝贝成长计划
      path: '/BabyPersonal',
      name: 'BabyPersonal',
      component: BabyPersonal,
      meta: {
        title: '我的宝贝金库'
      }
    },
    {
      //完善信息确认(第一次成功登录时跳转)
      path: '/CheckPerfectInfo/:id',
      name: 'CheckPerfectInfo',
      component: CheckPerfectInfo,
      meta: {
        title: '淘迪儿童银行-确认信息'
      }
    },
    {
      //完善信息确认
      path: '/SuccessInfo',
      name: 'SuccessInfo',
      component: SuccessInfo,
      meta: {
        title: '淘迪儿童银行-成为会员'
      }
    },
    {
      //设置支付密码
      path: '/SetPayPwd',
      name: 'SetPayPwd',
      component: SetPayPwd,
      meta: {
        title: '淘迪儿童银行-支付密码'
      }
    },
    {
      //幼儿园账单
      path: '/Bill',
      name: 'Bill',
      component: Bill,
      meta: {
        title: '幼儿园账单'
      }
    },
    {
      //资金明细
      path: '/Capital',
      name: 'Capital',
      component: Capital,
      meta: {
        title: '资金明细'
      }
    },
    {
      //缴费通知
      path: '/MyPay',
      name: 'MyPay',
      component: MyPay,
      meta: {
        title: '缴费通知'
      }
    },



    /*院长端*/
    {
      //院长端
      path: '/Admin',
      name: 'Admin',
      component: Admin,
      meta: {
        title: '淘迪儿童银行'
      }
    },

    /*理财产品详情*/
    {
      //理财产品详情
      path: '/Product/:id',
      name: 'Product',
      component: Product,
      meta: {
        title: '淘迪儿童银行-理财产品'
      }
    },
  ]
});






router.afterEach((to, from) => {
  if (to.meta.title) {
    document.title = to.meta.title;
  }
});
export default router;
